import React, { PureComponent } from 'react';
import { Switch, Route, Redirect } from 'react-router-dom';
import { Layout } from 'antd';

import GlobalHeader from '../components/GlobalHeader/index';
import styles from './user.module.css';
import logoPng from '../assets/img/logo.png';


/**
 * 用户Layout
 */
export default class UserLayout extends PureComponent {

  render() {

    const { getRouteData } = this.props;

    return (
      <Layout className={styles.layout}>
        <Layout.Header>
          <img className={styles.logo} src={logoPng} />
        </Layout.Header>
        <Layout.Content>
          <Switch>
            {
              getRouteData('UserLayout').map(item => 
                <Route exact key={item.path} path={item.path} component={item.component} />
              )
            }
          </Switch>
        </Layout.Content>
        <Layout.Footer>
            Footer Content
        </Layout.Footer>
      </Layout>
    )
  }
}